#ifndef __ME_IMAGE_BTN_INCLUDE__
#define __ME_IMAGE_BTN_INCLUDE__
#include <QImage>
#include <QMouseEvent>

class MeImageBtn :public QObject
{
	Q_OBJECT
public:
	MeImageBtn(const QString& tag ,QImage& image ,QString tooltip="");
	virtual ~MeImageBtn();
	void setImage(QImage& image);
	void draw(QPainter& painter, QPointF screenPos, bool isMovePlatfoem =false  , double heading = 0);
	QString getTag() const { return tag_; }
	QRectF boundingRect() const { return rect_;  }

	/* void on_mouseDoubleClickEvent(QMouseEvent *event);*/
	 bool on_mousePressEvent(QMouseEvent *event);
	 bool on_mouseMoveEvent(QMouseEvent *event);
	 bool on_mouseReleaseEvent(QMouseEvent *event);


	 enum mousePosState
	 {
		 inBtn,
		 outBtn
	 };

 signals:
	 void clicked(QString tag);
	 void enter(QString tag);
	 void leave(QString tag);

private:
	QImage image_;
	QRectF	rect_;
	QString tag_;
	mousePosState state_;
	QString toolTip_;
	bool isPressed; 

};


#endif